package com.d0306.Z06;

public class WanShu {
    public static void main(String[] args) {
        int i;
        int j;
        for (i = 1; i < 100; i++) {
            int sum=0;//每次循环sum从零开始
            for ( j = 1; j < i; j++) {
                if (i % j == 0) {
                    sum+=j;
                }
            }
            if(i==sum){
                System.out.println("完数为:"+i);
            }
        }
    }
}